import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;


public class ConnMysql 
{
  public static void main(String[] args) throws Exception
  {
	  Class.forName("com.mysql.jdbc.Driver");
	  Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/mysql", "root", "123");
	  Statement stmt = conn.createStatement();
	  ResultSet rs = stmt.executeQuery(("select * from user"));
	  while(rs.next())
	  {
		  System.out.println(rs.getBytes(1));
	  }
	  if(rs != null)
	  {
		  rs.close();
	  }
	  if (stmt != null)
	  {
		  stmt.close();
	  }
	  if (stmt !=null)
	  {
		  
	  }
  }
}
